<!DOCTYPE html>
<html>
 <head> 
  <meta name="format-detection" content="telephone=no" /> 
  <meta name="format-detection" content="email=no" /> 
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> 
  <meta name="apple-mobile-web-app-capable" content="yes" /> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
  <title>选择收货城市</title> 
  <script src="js/jquery.min.js"></script> 
  <script src="js/bootstrap.min.js"></script> 
  <link href="css/bootstrap.min.css" rel="stylesheet" /> 
  <script src="js/ygop.ajax.client.js"></script> 
  <script src="js/Common.v150812.js"></script> 
  <link href="css/public.v20150930.css" rel="stylesheet" /> 
  <script src="js/layer.m.js"></script> 
  <script type="text/javascript" src="js/jweixin-1.0.0.js"></script> 
  <link href="css/layer.css" rel="stylesheet" /> 


  <script type="text/javascript" src="js/ygm.dplus-0.5.js"></script> 
 </head> 
 <body> 
  <link href="css/gps.css" rel="stylesheet" /> 
  <div class="gpslayout"> 
   <h3 class="tittle">自配城市</h3> 
   <ul id="ulHotCity" class="hotul clearfix"></ul> 
   <h3 class="tittle">全部城市<span class="f10"> (各城市所能选购的商品不同，请正确选择送达城市) </span></h3> 
 <div id="divAllCity"><h4 class="key">A</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="安庆" code="16" cid="78d6e5b9-669d-481f-b395-cea5e1e6e5a0" class=""> <a>安庆 </a> </li></ul><h4 class="key">B</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="北京" code="2" cid="eabbe02f-59e0-46e6-90e7-cd8a89dbb98f" class="active"> <a>北京 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="北京(郊区)" code="32" cid="15b6c4e6-69f2-4001-a631-62c0c36102b1" class=""> <a>北京(郊区) </a> </li></ul><h4 class="key">C</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="长春" code="32" cid="25123e41-42e0-40e5-b2bd-76ba94daa655" class=""> <a>长春 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="常熟" code="4" cid="05037210-573c-436b-b24a-9d345dca54f7" class=""> <a>常熟 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="慈溪" code="4" cid="8a72d144-cc9b-42b4-884e-393854bb15ee" class=""> <a>慈溪 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="长沙" code="16" cid="e450593b-b52f-4233-b106-cb518acb3896" class=""> <a>长沙 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="沧州" code="32" cid="ee36933d-939f-4f6b-8a2b-d060ee9ca495" class=""> <a>沧州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="成都" code="16" cid="708f0b6e-91f2-4731-8576-07c78ea08351" class=""> <a>成都 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="重庆" code="16" cid="7c046210-81f3-4638-a09b-6b2e8ecbe957" class=""> <a>重庆 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="常州" code="4" cid="a338e3c1-e7e7-4482-b248-c5875b22a27b" class=""> <a>常州 </a> </li></ul><h4 class="key">D</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="大连" code="32" cid="3220a369-6a2d-4415-a46a-75a699214736" class=""> <a>大连 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="东莞" code="512" cid="20c2f64b-c91f-4095-8fb4-3f1fbbb55f82" class=""> <a>东莞 </a> </li></ul><h4 class="key">F</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="佛山" code="512" cid="6a637459-eca9-46b8-964d-35c11cad039a" class=""> <a>佛山 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="奉化" code="4" cid="c7f7d216-b6aa-4287-84ec-8d8cd0dbec04" class=""> <a>奉化 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="福州" code="16" cid="46e851bf-6fb4-4250-8c90-4f7774a176f1" class=""> <a>福州 </a> </li></ul><h4 class="key">G</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="广州" code="512" cid="c8dbd17f-a8e0-43b1-b9ce-de1efdc2670e" class=""> <a>广州 </a> </li></ul><h4 class="key">H</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="湖州" code="4" cid="9fb6eac6-ea03-409b-89d9-e13c27e01576" class=""> <a>湖州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="淮安" code="4" cid="3c2af8a1-c3eb-418b-97ee-e5f92c44f8ad" class=""> <a>淮安 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="合肥" code="16" cid="f2b41b20-c240-4e27-a7b4-5828f8fca3e9" class=""> <a>合肥 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="海宁" code="4" cid="7254d134-678b-4976-86f0-520fab6bcc46" class=""> <a>海宁 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="哈尔滨" code="32" cid="18cd4b6e-a0c3-4190-9988-c724c1da8bf5" class=""> <a>哈尔滨 </a> </li><li tdname="淳安县 临安市 富阳市 桐庐县 建德市" tdcode="4" ydname="下城区 上城区 西湖区 滨江区 江干区 拱墅区 余杭区 萧山区" ydcode="128" cname="杭州" code="128" cid="a10524be-acea-451e-9280-df0514e11e2b" class=""> <a>杭州 </a> </li></ul><h4 class="key">J</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="江阴" code="4" cid="72f8f62e-e5cb-418f-9419-a542c409d122" class=""> <a>江阴 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="济南" code="32" cid="97fe0ada-54d3-4b5f-9096-19ad57929d07" class=""> <a>济南 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="吉林" code="32" cid="69417568-9e3a-49c6-b21d-5282b7239922" class=""> <a>吉林 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="嘉兴" code="4" cid="ddd4e4d0-afb3-46c6-8aa6-6257c8ce9bee" class=""> <a>嘉兴 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="嘉善" code="4" cid="4673dd12-4056-4590-8267-8c0aff24b792" class=""> <a>嘉善 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="景德镇" code="16" cid="91c38a9c-30e0-4e44-af39-9b5d49928509" class=""> <a>景德镇 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="金华" code="4" cid="1e07c926-06e9-40cd-b257-a78d1d313ae7" class=""> <a>金华 </a> </li></ul><h4 class="key">K</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="昆山" code="128" cid="0dbb02ef-c055-429f-97b6-5dc7a5bfeda8" class=""> <a>昆山 </a> </li></ul><h4 class="key">L</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="辽阳" code="32" cid="297c5d78-4d09-42cc-ac13-8421f201b6a9" class=""> <a>辽阳 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="廊坊" code="256" cid="7f21282c-4bd0-45c0-a195-87663f9c27eb" class=""> <a>廊坊 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="连云港" code="4" cid="b2d5732b-b0f8-4fdf-b011-b95b31effa1d" class=""> <a>连云港 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="丽水" code="4" cid="b0efaf6f-ec54-4264-b0a5-2012a9ec7ee8" class=""> <a>丽水 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="兰州" code="32" cid="8edda15e-0e21-436c-978d-68eb5bb14ef7" class=""> <a>兰州 </a> </li></ul><h4 class="key">M</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="马鞍山" code="4" cid="45a989b7-d34e-40c7-aca1-990923eda2cd" class=""> <a>马鞍山 </a> </li></ul><h4 class="key">N</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="南昌" code="16" cid="75fbd2c7-8cbc-4bbd-94ef-5eb037a75be5" class=""> <a>南昌 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="南宁" code="64" cid="7cd187b5-8b3f-4c1a-8115-24a5e2d18f3a" class=""> <a>南宁 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="南通" code="4" cid="603d28a7-b4c8-4a13-823f-d627c2655557" class=""> <a>南通 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="南京" code="4" cid="9069d884-96c5-4478-bb49-d6ba55b751c8" class=""> <a>南京 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="宁波" code="128" cid="c0a5de4e-9087-4678-9056-f589ad833656" class=""> <a>宁波 </a> </li></ul><h4 class="key">Q</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="衢州" code="4" cid="4693602d-80d7-4b72-b3b5-ca6a26f051f1" class=""> <a>衢州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="泉州" code="16" cid="2b3763ec-2491-4ee0-97a6-20cf70f81933" class=""> <a>泉州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="秦皇岛" code="32" cid="5d9e78ba-c583-4962-b279-2a8948df9ee1" class=""> <a>秦皇岛 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="青岛" code="32" cid="7ced387b-577d-4060-83d1-13b78f60ff53" class=""> <a>青岛 </a> </li></ul><h4 class="key">S</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="上海(郊区)" code="16" cid="98373b1b-201c-4753-b540-14bb1cd6564e" class=""> <a>上海(郊区) </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="宿迁" code="4" cid="7e8111e6-d7ce-41ce-a660-3033ab81705c" class=""> <a>宿迁 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="绍兴" code="4" cid="df2e0859-ed44-4e81-95a5-1c8b59381b99" class=""> <a>绍兴 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="沈阳" code="32" cid="191a03f0-5acf-4bba-8d79-551fa80f77c2" class=""> <a>沈阳 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="石家庄" code="256" cid="28eab84c-07bf-439f-bb96-92274545c77b" class=""> <a>石家庄 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="上海" code="1" cid="312d0556-0671-4f2e-8bac-7b8873b5a03a" class=""> <a>上海 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="苏州" code="128" cid="dec5b754-fe58-48d6-8b37-6bc91ee08460" class=""> <a>苏州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="深圳" code="512" cid="0540d74e-0ffb-4a3a-ab79-ec590dd49947" class=""> <a>深圳 </a> </li></ul><h4 class="key">T</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="太原" code="32" cid="245dccf7-34cb-466f-aa68-45a242927e18" class=""> <a>太原 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="天津" code="8" cid="93570b8c-0a0a-4818-8317-75a0d14093a5" class=""> <a>天津 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="桐乡" code="16" cid="0d920097-3f8a-4ac5-8d48-c7ba7b344ab3" class=""> <a>桐乡 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="泰州" code="4" cid="6ba21255-37f7-4619-859c-fde2bb914c4c" class=""> <a>泰州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="台州" code="4" cid="5fddc946-9a0c-4dad-bc92-5e05aa5658cd" class=""> <a>台州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="唐山" code="32" cid="17ee7ac2-d7ce-4c02-80ea-1babea0a8933" class=""> <a>唐山 </a> </li></ul><h4 class="key">W</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="吴江" code="4" cid="33b3203d-c4b6-4c91-abd0-f3f0a226e461" class=""> <a>吴江 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="无锡" code="128" cid="361bc174-b1e5-4fb6-8f69-c391dcd92644" class=""> <a>无锡 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="温州" code="4" cid="734d3328-587c-4b16-bddc-9c8682e76ea5" class=""> <a>温州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="武汉" code="16" cid="3a5c6df3-9ca1-41a8-bc9c-453050bb7897" class=""> <a>武汉 </a> </li></ul><h4 class="key">X</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="厦门" code="16" cid="146a4ea1-7ba2-4e0b-bf92-a56ddc2d4eb2" class=""> <a>厦门 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="西安" code="16" cid="9a2b3612-8529-4ddf-86bd-60b7a46444a7" class=""> <a>西安 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="徐州" code="4" cid="95e8ce6d-2c7e-4364-9b66-8903c1afd338" class=""> <a>徐州 </a> </li></ul><h4 class="key">Y</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="扬州" code="4" cid="3ed942ac-0504-479b-8808-4d9ca08df39b" class=""> <a>扬州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="银川" code="32" cid="d1c0ada7-06b3-4d53-8f91-ccdc9f61d9ba" class=""> <a>银川 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="盐城" code="4" cid="36ccf429-efe3-4192-9530-6fbee4984621" class=""> <a>盐城 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="烟台" code="32" cid="7d381d70-fc5a-4d1c-8dd0-9400fd5280fd" class=""> <a>烟台 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="义乌" code="4" cid="c9d4fe94-a93a-4382-bf3f-acc16233a71d" class=""> <a>义乌 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="余姚" code="4" cid="6b804583-e3d5-47d5-8bc5-a6a1f46a4cf8" class=""> <a>余姚 </a> </li></ul><h4 class="key">Z</h4><ul class="commonul clearfix"><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="舟山" code="4" cid="04d2148e-5d5a-4372-a8a1-ad6fd9756b2b" class=""> <a>舟山 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="镇江" code="4" cid="26b6f9a2-850b-4cab-be30-d62e6221dab9" class=""> <a>镇江 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="珠海" code="512" cid="0718b3bf-b99b-4aa4-97bd-4a4da0b92464" class=""> <a>珠海 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="郑州" code="32" cid="2aac03c9-daf1-4aa8-9505-0bc169742e8a" class=""> <a>郑州 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="淄博" code="32" cid="9e21dcb6-47fa-42f8-89c3-9216ba489f1e" class=""> <a>淄博 </a> </li><li tdname="null" tdcode="null" ydname="null" ydcode="null" cname="中山" code="512" cid="29bd9fa7-274c-4257-85e2-a22e2cd1d2ce" class=""> <a>中山 </a> </li></ul></div>
  </div> 
  <div class="modal" id="divYT" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> 
   <div class="modal-dialog" role="document"> 
    <div class="modal-content"> 
     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 
     <div class="invoice"> 
      <dl> 
       <dt>
        根据您在
        <font id="selectedCityName"></font>的区域选择配送方式
       </dt> 
       <dd id="yt_type"> 
        <span id="spYD"> <input id="yd_dev" type="radio" name="type" code="" ytid="" cname="" /> <label for="yd_dev">易果物流</label> 
         <div id="divYD"></div> </span> 
        <span id="spTD"> <input id="td_dev" type="radio" name="type" code="" ytid="" cname="" /> <label for="td_dev">第三方物流</label> 
         <div id="divTD"></div> </span> 
       </dd> 
      </dl> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script>
    $(function () {
        getCityList();
    })

    function getCityList() {
//        YgmJsCommon.popups.loading();
    }

    //加载自配城市列表
    function loadHostCity(data) {
        data = data.HotCitys;
        var html = "";
        for (var i = 0; i < data.length; i++) {
            html += '<li class="' + showActiveClass(data[i].Id) + '"  cid="' + data[i].Id + '" code="' + data[i].Code + '" cname="' + data[i].Name + '" YDcode="' + data[i].YD.Code + '" YDname="' + data[i].YD.Text + '" TDcode="' + data[i].TD.Code + '" TDname="' + data[i].TD.Text + '" > <a>' + data[i].Name + ' </a> </li>';
        }
        $("#ulHotCity").html(html);
    }

    //加载所有城市列表
    function loadAllCity(allData) {
        var html = '';
        for (var k in allData) {
            if (k != "HotCitys") {
                var data = allData[k];
                html += '<h4 class="key">' + k + '</h4><ul class="commonul clearfix">';
                for (var i = 0; i < data.length; i++) {
                    html += '<li class="' + showActiveClass(data[i].Id) + '"  cid="' + data[i].Id + '" code="' + data[i].Code + '" cname="' + data[i].Name + '" YDcode="' + data[i].YD.Code + '" YDname="' + data[i].YD.Text + '"  TDcode="' + data[i].TD.Code + '" TDname="' + data[i].TD.Text + '" > <a>' + data[i].Name + ' </a> </li>';
                }
                html += '</ul>';
            }
        }
        $("#divAllCity").html(html);
    }

    //显示选中城市的样式
    function showActiveClass(id) {
        var obj = YgmJsCommon.getCityCookie();
        if (obj != null) {
            var cid = obj.Id;
            if (id != null && id != "" && cid != null && cid != "" && cid.toLowerCase() == id.toLowerCase()) {
                return "active";
            }
        }
        return "";
    }

    //选择城市绑定事件
    function seletedCityOperate() {
        $(".gpslayout").find("li").each(function (i, n) {
            $(this).click(function () {
                var cname = $(this).attr("cname");
                var id = $(this).attr("cid");

                var YDcode = $(this).attr("YDcode");
                var YDname = $(this).attr("YDname");

                var TDcode = $(this).attr("TDcode");
                var TDname = $(this).attr("TDname");

                //显示第三方配送物流
                var bl = false;
                if (YDcode != null && YDcode != "null" && YDcode != undefined) {
                    $("#yd_dev").attr("ytid", id);
                    $("#yd_dev").attr("code", YDcode);
                    $("#divYD").text(YDname);
                    bl = true;
                }
                else {
                    bl = false;
                }
                if (TDcode != null && TDcode != "null" && TDcode != undefined) {
                    $("#td_dev").attr("ytid", id);
                    $("#td_dev").attr("code", TDcode);
                    $("#divTD").text(TDname);
                    bl = true;
                }
                else {
                    bl = false;
                }
                if (bl) {
                    //弹出选择物流框
                    $("#yd_dev").attr("cname", cname);
                    $("#td_dev").attr("cname", cname);
                    $("#selectedCityName").html(cname);
                    selectedYTClass();
                    YTOperate();
                    //$("#btnYT").click();
                    $("#divYT").modal('show');
                }
                else {
                    var id = $(this).attr("cid");
                    var code = $(this).attr("code");
                    var name = $(this).attr("cname");
                    clearCartAfterChangeCity(id, code, name);
                }
            })

        })
    }

    //绑定第三方物流选择事件
    function YTOperate() {
        $("#yt_type").find("input").each(function (i, n) {
            $(this).click(function () {
                var id = $(this).attr("ytid");
                var code = $(this).attr("code");
                var name = $(this).attr("cname");
                //更改城市
                clearCartAfterChangeYTCity(id, code, name);
            })
        })
    }

    //显示选中的第三方物流
    function selectedYTClass() {
        var obj = YgmJsCommon.getCityCookie();
        if (obj != null) {
            var ccode = obj.Code;
            var YDcode = $("#yd_dev").attr("code");
            var TDcode = $("#td_dev").attr("code");
            if (ccode == YDcode && YDcode != null && YDcode != "null") {
                $("#yd_dev").attr("checked", true);
            }
            else if (ccode == TDcode && TDcode != null && TDcode != "null") {
                $("#td_dev").attr("checked", true);
            }
        }
        return "";
    }


    //清空购物车更改城市
    function clearCartAfterChangeCity(id, code, name) {
        var obj = YgmJsCommon.getCityCookie();
        if (obj != null) {
            var cid = obj.Id;
            if (id != null && id != "" && cid != null && cid != "" && cid.toLowerCase() != id.toLowerCase()) {
                YgmJsCommon.popups.confirm("切换城市将清空购物车", function (r) {
                    //清空购物车
                    YgmJsCommon.clearCartProducts();
                    //更改城市
                    changeCity(id, code, name);
                });
            }
            else {
                //更改城市
                changeCity(id, code, name);
            }
        }
    }
    function clearCartAfterChangeYTCity(id, code, name) {
        var obj = YgmJsCommon.getCityCookie();
        if (obj != null) {
            var ccode = obj.Code;
            if (code != null && code != "" && ccode != null && ccode != "" && ccode != code) {
                YgmJsCommon.popups.confirm("切换城市将清空购物车", function (r) {
                    //清空购物车
                    YgmJsCommon.clearCartProducts();
                    //更改城市
                    changeCity(id, code, name);
                });
            }
            else {
                //更改城市
                changeCity(id, code, name);
            }
        }
    }

    //更改城市
    function changeCity(id, code, name) {
        var ygmCity = {};
        ygmCity.Id = id;
        ygmCity.Code = code;
        ygmCity.Name = encodeURI(name);
        ygmCity.Default = 0;
        YgmJsCommon.updateCityCookie(ygmCity);
        //window.history.back();
        var url = document.referrer;
        if (url.indexOf('MktActivity/KiwiGameActivity.aspx?') != -1) {
            location.href = url.substring(0, url.indexOf('?'));
        }
        else {
            location.href = url;
        }
    }
    $('#divYT').on('shown.bs.modal', function () {
        var win_width = $(this).find(".modal-dialog").width();
        var win_height = $(this).find(".modal-dialog").height();
        $(this).find(".modal-dialog").css({ "marginTop": String(-1 * win_height / 2) + "px", "marginLeft": String(-1 * win_width / 2) + "px" });

    });
</script>   
  <script type="text/javascript">
    var _wx_JsConfig = {};
    _wx_JsConfig.appid = "wx0d4f4f0e0bada80e";
    _wx_JsConfig.imgUrl = "http://img02.yiguo.com/e/web/150930/00783/155744/wxlogo.jpg";
    _wx_JsConfig.title = "易果生鲜触屏版";
    _wx_JsConfig.content = "全国首家生鲜专业电商，全球优质生鲜产地直供，全年无休生鲜冷链配送";
    _wx_JsConfig.timeLineLink = "http://weixin.m.yiguo.com";

    _wx_JsConfig.timestamp = "";
    _wx_JsConfig.nonceStr = "";
    _wx_JsConfig.signature = "";

    $(function () {
        YgmJsCommon.domain = "yiguo.com";

        var jsonWxCfg = decodeURIComponent("%7b%22appId%22%3anull%2c%22timestamp%22%3a%221445764067%22%2c%22nonceStr%22%3a%221309023766%22%2c%22signature%22%3a%22e2a17be2afc998e3aa93c0cb9a770d230737cc4f%22%2c%22url%22%3a%22http%3a%2f%2fweixin.m.yiguo.com%2fHome%2fSelectCity%22%2c%22jsapi_ticket%22%3a%22bxLdikRXVbTPdHSM05e5u_n3yqdZ_9Pt0dvnbtzvrXZPXGW78SQIZS6crf1Q43wpEpALKFKH0hfQ0NJKbEUPPw%22%7d");
        var wxJsCfg = JSON.parse(jsonWxCfg);
        _wx_JsConfig.timestamp = wxJsCfg.timestamp;
        _wx_JsConfig.nonceStr = wxJsCfg.nonceStr;
        _wx_JsConfig.signature = wxJsCfg.signature;

        wx.config({
            //debug: true,
            appId: _wx_JsConfig.appid,
            timestamp: _wx_JsConfig.timestamp,
            nonceStr: _wx_JsConfig.nonceStr,
            signature: _wx_JsConfig.signature,
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage'
            ]
        });

        myShare();
    });

    function myShare() {
        wx.ready(function () {
            //分享朋友圈
            wx.onMenuShareTimeline({
                title: _wx_JsConfig.title,
                desc: _wx_JsConfig.content, // 分享描述
                link: _wx_JsConfig.timeLineLink,
                imgUrl: _wx_JsConfig.imgUrl,
                trigger: function (res) {
                },
                success: function (res) {
                    dplus.track("分享到朋友圈");
                },
                cancel: function (res) {
                },
                fail: function (res) {
                }
            });
            //分享朋友
            wx.onMenuShareAppMessage({
                title: _wx_JsConfig.title,
                desc: _wx_JsConfig.content,
                link: _wx_JsConfig.timeLineLink,
                imgUrl: _wx_JsConfig.imgUrl,
                trigger: function (res) {
                },
                success: function (res) {
                    dplus.track("分享给朋友");
                },
                cancel: function (res) {
                },
                fail: function (res) {
                }
            });
        });

    }

    window.onload = function () {
        
    };
</script>
 </body>
</html>